layui.define(['form', 'table'], function(exports){
  var $ = layui.$,table = layui.table,form = layui.form;

  var id =$('input[name="id"]').val();

    table.render({
        elem: '#LAY-table'
        ,url: layui.setter.webRoot + '/device/upgrade/task/process/list.data'
        ,where:{id:id}
        ,method: 'post'
        ,parseData: function (res) {
            return {
                "code": res.code,
                "msg": res.msg,
                "count": res.body.total,
                "data": res.body.data
            };
        }
        ,response: {statusCode: 200}
        ,cols: [[
            {field: 'date',title: '时间'}
            ,{field: 'note', title: '内容'}
        ]]
        ,page: false
        ,height: 'full'
        ,text: '对不起，加载出现异常！'
    });

    var active = {
    }

    $('.layui-btn.LAY-btn-fun').on('click', function(){
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
    });

    table.on('tool(LAY-table)', function(obj){
        var type = obj.event ;
        active[type] ? active[type].call(this,obj) : '';
    });
  
  exports('device_upgrade_task_info', {})
});